package com.yaorange.module.system.controller;

import com.yaorange.module.system.entity.vo.PermissionTreeVO;
import com.yaorange.module.system.service.SysPermissionService;
import com.yaorange.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sys/permission")
public class SysPermissionController {
    @Autowired
    private SysPermissionService sysPermissionService;

    /**
     *  获取权限树
     * @return
     */
    @GetMapping
    public Result<List<PermissionTreeVO>> getPermissionsTree(){
        return Result.success(sysPermissionService.findPermissionsTree());
    }



}
